import Vue from "vue";
import VueRouter from "vue-router";

const routerPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
  return routerPush.call(this, location).catch((err) => {});
};
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "layout",
    meta: {
      name: "首页",
    },
    component: () => import("@/views/Layout/index.vue"),
    children: [
      {
        path: "/notice",
        name: "notice",
        meta: {
          name: "通知管理",
        },
        // component: () => import("@/views/Notice/index.vue"),
        component: () => import("@/views/Notice/adminIndex.vue"),

      },
      {
        path: "/playerManage",
        name: "playerManage",
        meta: {
          name: "球员管理",
        },
        component: () => import("@/views/playerManage/index.vue"),

      },
      {
        path: "/raceManage",
        name: "raceManage",
        meta: {
          name: "比赛管理",
        },
        component: () => import("@/views/raceManage/index.vue"),

      },
      {
        path: "/trainManage",
        name: "trainManage",
        meta: {
          name: "训练管理",
        },
        component: () => import("@/views/trainManage/index.vue"),

      },
      {
        path:'/dManage',
        name:"dManage",
        meta:{
          name:'日程管理'
        },
        component: () => import("@/views/dateManage/index.vue"),
      },
      {
        path:'/permissionManage',
        name:"permissionManage",
        meta:{
          name:'权限管理'
        },
        component: () => import("@/views/permissionManage/index.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
